import Vue from 'vue'
import Vuex from 'vuex'
import pluginPersist from "@/utils/pluginPersist"
Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        //登录状态
        loginState: false,
        registerList: {
            username: '',
            phoneNumber: '',
            userId: ''
        },
    },
    getters: {},
    mutations: {
        changeLogin(state) {
            state.loginState = !state.loginState
        },
        changeregisterList(state, pepole) {
            state.registerList.username = pepole.username
            state.registerList.phoneNumber = pepole.phoneNumber
            state.registerList.userId = pepole.userId
            return state.registerList
        },
    },
    actions: {},
    modules: {},

    plugins: [pluginPersist],
})
